package com.haibei.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;

import com.haibei.R;

public class GuiderImageAdapter extends BaseAdapter {

	private LayoutInflater mInflater;
	private int ids[] = { R.drawable.m1, R.drawable.m2, R.drawable.m3, R.drawable.m4, R.drawable.m5 };
	private onGoClickListener onGoClickListener;

	public GuiderImageAdapter(Context context) {
		mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	@Override
	public int getCount() {

		return ids.length;
	}

	@Override
	public Object getItem(int position) {
		return position;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = mInflater.inflate(R.layout.item_guider, null);
		}
		ImageView imageView = (ImageView) convertView.findViewById(R.id.imageView);
		if (null != imageView) {
			imageView.setImageResource(ids[position]);
		}
		return convertView;
	}

	public static interface onGoClickListener {
		public void onGoClick();
	}

	public onGoClickListener getOnGoClickListener() {
		return onGoClickListener;
	}

	public void setOnGoClickListener(onGoClickListener onGoClickListener) {
		this.onGoClickListener = onGoClickListener;
	}

}
